<?php
namespace App\Transformers;

use League\Fractal\TransformerAbstract;
use App\Model\ProductSaleMonth;

class ProductSaleMonthTransformer extends TransformerAbstract{

    public function transform(ProductSaleMonth $item){
        return [
            'id' => $item->id,
            'product' => $item->product()->first(),
            'month' => $item->month,
            'year' => $item->year,
            'sale_count' => $item->sale_count,
            'total_amount' => $item->total_amount
        ];
    }
}